<?php

$pluginName = 'zenityupload'; //based on shellscript
class uploadPlugins_zenityupload extends BaseUpload
{
	public function process()
	{
		if(empty($this->data))
		{
			$this->error();
		}
		
		foreach(debug($this->data, 'REQUEST data', JGLIB_DEBUG_PER3) as $d)
		{
			$tmp = debug(explode(':', $d), 'Explode data', JGLIB_DEBUG_PER3);
			$this->addUploadedFile(debug(new File($tmp[0], $tmp[1]), 'New file', JGLIB_DEBUG_PER3));
		}
		
		return parent::process();
	}
	
	public function success()
	{
		die ('ok');
	}
	
	public function error()
	{
		die ('nok');
	}
}
